package com.haidechizi.fastadmin.modules.code.entity;

import com.haidechizi.fastadmin.common.validator.group.Group;
import com.haidechizi.fastadmin.common.validator.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author wangdejun
 * @create 2020/10/30 14:05
 */
@Data
public class DynamicCodeConfig implements Serializable {

    private static final long serialVersionUID = 7475801674930855950L;
    // 文件路径
    @NotBlank(message = "文件路径不能为空", groups = Group.class)
    private String filePath;
    private String keyGeneratorType;    // 0。不处理，1.驼峰
    @NotBlank(message = "系统Code不能为空", groups = UpdateGroup.class)
    private String systemCode;
    @NotBlank(message = "业务Code不能为空", groups = UpdateGroup.class)
    private String businessCode;
    @NotBlank(message = "业务Key不能为空", groups = UpdateGroup.class)
    private String businessKey;
    @NotBlank(message = "类名正则不能为空", groups = UpdateGroup.class)
    private String i18nModelReplacePattern;
    @NotNull
    private List<DynamicCodeField> configList = new ArrayList<>(16);

    private boolean backupFile;
    private boolean generateNewFile;
    private boolean replaceFile;
}
